package struct.advanced.set;

import struct.intermediate.tree.BinarySearchTree;

/**
 * @author MAX
 * @version 1.0
 * @description 高级数据结构-基于二分搜索树的集合
 * @date 2022/1/17 09:28
 */
public class BstSet<E extends Comparable<E>> implements Set<E> {

    private BinarySearchTree<E> bst;

    public BstSet() {
        bst = new BinarySearchTree<>();
    }

    @Override
    public void add(E e) {
        bst.add(e);
    }

    @Override
    public void remove(E e) {

    }

    @Override
    public boolean contains(E e) {
        return bst.contains(e);
    }

    @Override
    public int size() {
        return bst.size();
    }

    @Override
    public boolean isEmpty() {
        return bst.isEmpty();
    }
}
